<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
        <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
        <link rel="stylesheet" href="${ctxStatic}/css/list.css">
        <script type="text/javascript">
            $(document).ready(function(){
                // 下拉选框带搜索功能
              	$("#styleCategoryCd").select2(); 
                searchListForm();
            });
            //检索
            function searchListForm() {
                var styleCategoryCD = $("#styleCategoryCd").val();
                $("#activity_pane").showLoading();
                $.post("${ctx}/custom/fitproperty/searchList?styleCategoryCd="+styleCategoryCD,"", function(result) {
                    var listHtml = result["fitProperty"];
                    var pageHtml = result["page"];
                    $("#listHtml").html(listHtml);
                    $("#paging").html(pageHtml);
                    $("#activity_pane").hideLoading();
                }, 'json');
            }
            //重置
            function clean(){
                $("input").val("");
                $('#styleCategoryCd').val('');
                $("#styleCategoryCd").select2(); 
                $("#searchForm").submit();
            }
            
            //导入/导出ecxcel
            function importExcel(){
                
                var url="${ctx}/common/importExcel?action=${ctx}/custom/fitproperty/import&template=${ctx}/custom/fitproperty/import/template";
                
                popup('400px','230px',url);
            }
        </script> 
    </head>
    <body>
    <div class="listArea" id="activity_pane">
        <form  id="searchForm"  method="post">
            <div class="listBg">
                <div class="searchArea clearfix">
                    <div class="searchLeft big clearfix" style="width:800px">
                        <div class="searchSm clearfix">
                        <!-- 项目款式分类查询 -->
                        <p class="searchInp clearfix">
                            <spring:message code="fitproperty_styleCategory"/>
                        </p>
                        <div class="searchInp" >
                            <c:set value="<%=ResourcesUtil.getConfig(\"style_category\")%>" var="styleCategoryList" />
                             <select id="styleCategoryCd" name="styleCategoryCd" style="width:150px">
                                 <!--请输入款式-->
                                 <option value=''><spring:message code="custom_style_alert"/></option>
                                  <c:forEach items="${fns:getDictList(styleCategoryList)}"   var="style">
                                       <option  <c:if test="${fn:split(fitProperty.styleCategoryCd,'-')[1] eq style.itemValue}">selected="selected"</c:if> value="${style.itemCode}-${style.itemValue}" >
                                              ${style.itemName}
                                     </option>
                                  </c:forEach>
                              </select>
                        </div>
                    </div>
                </div>
                    <div class="searchRight searchRightLg" id="subItem">
                    <shiro:hasPermission name="custom:fitproperty:edit">
                    <!-- 导入/导出 -->
                    <button type="button" class="btn-cj" onclick="importExcel()"><spring:message code="common_im_export"/></button>
                    <!-- 新建项目 -->
                    <button type="button" class="btn-cj" onclick="popup('935px','550px','${ctx}/custom/fitproperty/form')"><spring:message code="fitproperty_create"/></button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="custom:fitproperty:view">
                    <!--重置  -->
                    <button type="button" class="btn-js" onclick="clean();"><spring:message code="fitproperty_reset"/></button>
                    <!-- 查询 -->
                    <button type="button" class="btn-js" onclick="return page();"><spring:message code="commom_check"/></button>
                    </shiro:hasPermission>
                </div>
               </div>
                <div class="tableArea">
                    <div class="tableScrollSm" style="overflow: auto;width: 1293px;height: 714px; ">
                    <table cellpadding="0" class="tableHead" >
                        <thead>
                    <tr>
                        <!-- No. -->
                        <th><p class="table-No">
                            <spring:message code="common_no" />
                        </p></th>
                        <!-- 项目CODE -->
                        <th><p class="table-cus-xmCD">
                            <spring:message code="fitproperty_Cd" />
                        </p></th>
                        <!-- 中文全称 -->
                        <th><p class="table-cus-zwmc">
                            <spring:message code="fitproperty_Cn" />
                        </p></th>
                        <!-- 英文全称 -->
                        <th><p class="table-cus-ywmc">
                            <spring:message code="fitproperty_En" />
                        </p></th>
                        <!-- 日文全称 -->
                        <th><p class="table-cus-rwmc">
                            <spring:message code="fitproperty_Jp" />
                        </p></th>
                        <!-- 备注 -->
                        <th><p class="table-cus-bz">
                            <spring:message code="fitproperty_remarks" />
                        </p></th>
                        <!-- 状态 -->
                        <th><p class="table-cus-zt">
                            <spring:message code="fitproperty_state" />
                        </p></th>
                        <!-- 最后更新者 -->
                        <th><p class="table-cus-zhgxz">
                            <spring:message code="fitproperty_updateUser" />
                        </p></th>
                        <!-- 更新日期 -->
                        <th><p class="table-cus-zhgxrq">
                            <spring:message code="fitproperty_update" />
                        </p></th>
                </tr>
                </thead>
                    </table>
                    <table cellpadding="0" class="tableBody" >
                            <tbody  id = "listHtml"></tbody>
                    </table>
                </div>
                </div>
             </div>
            <div id = "paging" ></div>
        </form>
    </div>
    </body>
</html>